<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var time = new Date();

        function show () {
            time = '2022'; // 污染全局变量
            console.log('inner:', time);
        }
        show ()
        console.log('out:', time);
        var time = new Date();

        var time1 = new Date();
        function show1 () {
            console.log(time1);
            if(false) {
                var time1 = '2022'
            }
        }
        show1 ()
        console.log(time1);

        function es6() {
            let a = 'a';
            if(true) {
                let a = 'b';
                console.log(11111, a);
            }
            console.log(a);
        }
        es6()
    </script>
</body>
</html>